<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
 <head>
  <meta http-equiv="content-type" content="text/html; charset=UTF-8">
  <title>运行时配置</title>

 </head>
 <body><div class="manualnavbar" style="text-align: center;">
 <div class="prev" style="text-align: left; float: left;"><a href="mysqlnd-qc.installation.html">安装</a></div>
 <div class="next" style="text-align: right; float: right;"><a href="mysqlnd-qc.constants.html">预定义常量</a></div>
 <div class="up"><a href="mysqlnd-qc.setup.html">安装／配置</a></div>
 <div class="home"><a href="index.html">PHP Manual</a></div>
</div><hr /><div id="mysqlnd-qc.configuration" class="section">
 <h2 class="title">运行时配置</h2>
 <p class="simpara">
这些函数的行为受 <var class="filename">php.ini</var> 中的设置影响。
</p>
 <p class="para">
  <table class="doctable table">
   <caption><strong>mysqlnd_qc 配置选项</strong></caption>
   
    <thead>
     <tr>
      <th>名字</th>
      <th>默认</th>
      <th>可修改范围</th>
      <th>更新日志</th>
     </tr>

    </thead>

    <tbody class="tbody">
     <tr>
      <td><a href="mysqlnd-qc.configuration.html#ini.mysqlnd-qc.enable-qc" class="link">mysqlnd_qc.enable_qc</a></td>
      <td>1</td>
      <td>PHP_INI_SYSTEM</td>
      <td>
      </td>
     </tr>

     <tr>
      <td><a href="mysqlnd-qc.configuration.html#ini.mysqlnd-qc.ttl" class="link">mysqlnd_qc.ttl</a></td>
      <td>30</td>
      <td>PHP_INI_ALL</td>
      <td>
      </td>
     </tr>

     <tr>
      <td><a href="mysqlnd-qc.configuration.html#ini.mysqlnd-qc.cache-by-default" class="link">mysqlnd_qc.cache_by_default</a></td>
      <td>0</td>
      <td>PHP_INI_ALL</td>
      <td>
      </td>
     </tr>

     <tr>
      <td><a href="mysqlnd-qc.configuration.html#ini.mysqlnd-qc.cache-no-table" class="link">mysqlnd_qc.cache_no_table</a></td>
      <td>0</td>
      <td>PHP_INI_ALL</td>
      <td>
      </td>
     </tr>

     <tr>
      <td><a href="mysqlnd-qc.configuration.html#ini.mysqlnd-qc.use-request-time" class="link">mysqlnd_qc.use_request_time</a></td>
      <td>0</td>
      <td>PHP_INI_ALL</td>
      <td>
      </td>
     </tr>

     <tr>
      <td><a href="mysqlnd-qc.configuration.html#ini.mysqlnd-qc.time-statistics" class="link">mysqlnd_qc.time_statistics</a></td>
      <td>1</td>
      <td>PHP_INI_ALL</td>
      <td>
      </td>
     </tr>

     <tr>
      <td><a href="mysqlnd-qc.configuration.html#ini.mysqlnd-qc.collect-statistics" class="link">mysqlnd_qc.collect_statistics</a></td>
      <td>0</td>
      <td>PHP_INI_ALL</td>
      <td>
      </td>
     </tr>

     <tr>
      <td><a href="mysqlnd-qc.configuration.html#ini.mysqlnd-qc.collect-statistics-log-file" class="link">mysqlnd_qc.collect_statistics_log_file</a></td>
      <td>/tmp/mysqlnd_qc.stats</td>
      <td>PHP_INI_SYSTEM</td>
      <td>
      </td>
     </tr>

     <tr>
      <td><a href="mysqlnd-qc.configuration.html#ini.mysqlnd-qc.collect-query-trace" class="link">mysqlnd_qc.collect_query_trace</a></td>
      <td>0</td>
      <td>PHP_INI_SYSTEM</td>
      <td>
      </td>
     </tr>

     <tr>
      <td><a href="mysqlnd-qc.configuration.html#ini.mysqlnd-qc.query-trace-bt-depth" class="link">mysqlnd_qc.query_trace_bt_depth</a></td>
      <td>3</td>
      <td>PHP_INI_SYSTEM</td>
      <td>
      </td>
     </tr>

     <tr>
      <td><a href="mysqlnd-qc.configuration.html#ini.mysqlnd-qc.collect-normalized-query-trace" class="link">mysqlnd_qc.collect_normalized_query_trace</a></td>
      <td>0</td>
      <td>PHP_INI_SYSTEM</td>
      <td>
      </td>
     </tr>

     <tr>
      <td><a href="mysqlnd-qc.configuration.html#ini.mysqlnd-qc.ignore-sql-comments" class="link">mysqlnd_qc.ignore_sql_comments</a></td>
      <td>1</td>
      <td>PHP_INI_ALL</td>
      <td>
      </td>
     </tr>

     <tr>
      <td><a href="mysqlnd-qc.configuration.html#ini.mysqlnd-qc.slam-defense" class="link">mysqlnd_qc.slam_defense</a></td>
      <td>0</td>
      <td>PHP_INI_SYSTEM</td>
      <td>
      </td>
     </tr>

     <tr>
      <td><a href="mysqlnd-qc.configuration.html#ini.mysqlnd-qc.slam-defense-ttl" class="link">mysqlnd_qc.slam_defense_ttl</a></td>
      <td>30</td>
      <td>PHP_INI_SYSTEM</td>
      <td>
      </td>
     </tr>

     <tr>
      <td><a href="mysqlnd-qc.configuration.html#ini.mysqlnd-qc.std-data-copy" class="link">mysqlnd_qc.std_data_copy</a></td>
      <td>0</td>
      <td>PHP_INI_SYSTEM</td>
      <td>
      </td>
     </tr>

     <tr>
      <td><a href="mysqlnd-qc.configuration.html#ini.mysqlnd-qc.apc-prefix" class="link">mysqlnd_qc.apc_prefix</a></td>
      <td>qc_</td>
      <td>PHP_INI_ALL</td>
      <td>
      </td>
     </tr>

     <tr>
      <td><a href="mysqlnd-qc.configuration.html#ini.mysqlnd-qc.memc-server" class="link">mysqlnd_qc.memc_server</a></td>
      <td>127.0.0.1</td>
      <td>PHP_INI_ALL</td>
      <td>
      </td>
     </tr>

     <tr>
      <td><a href="mysqlnd-qc.configuration.html#ini.mysqlnd-qc.memc-port" class="link">mysqlnd_qc.memc_port</a></td>
      <td>11211</td>
      <td>PHP_INI_ALL</td>
      <td>
      </td>
     </tr>

     <tr>
      <td><a href="mysqlnd-qc.configuration.html#ini.mysqlnd-qc.sqlite-data-file" class="link">mysqlnd_qc.sqlite_data_file</a></td>
      <td>:memory:</td>
      <td>PHP_INI_ALL</td>
      <td>
      </td>
     </tr>

    </tbody>
   
  </table>

 </p>

 <p class="para">这是配置指令的简短说明。</p>

 <p class="para">
  <dl>

   
    <dt id="ini.mysqlnd-qc.enable-qc">
     <em><code class="parameter">mysqlnd_qc.enable_qc</code></em>
     <span class="type"><a href="language.types.integer.html" class="type integer">integer</a></span>
    </dt>

    <dd>

     <p class="para">
      Enables or disables the plugin. If disabled the extension will not plug
      into
      <a href="book.mysqlnd.html" class="link">mysqlnd</a> to proxy internal
      <a href="book.mysqlnd.html" class="link">mysqlnd</a> C API calls.
     </p>
    </dd>

   
   
    <dt id="ini.mysqlnd-qc.ttl">
     <em><code class="parameter">mysqlnd_qc.ttl</code></em>
     <span class="type"><a href="language.types.integer.html" class="type integer">integer</a></span>
    </dt>

    <dd>

     <p class="para">
             Default Time-to-Live (TTL) for cache entries in seconds.
     </p>
    </dd>

   
   
    <dt id="ini.mysqlnd-qc.cache-by-default">
     <em><code class="parameter">mysqlnd_qc.cache_by_default</code></em>
     <span class="type"><a href="language.types.integer.html" class="type integer">integer</a></span>
    </dt>

    <dd>

     <p class="para">
      Cache all queries regardless if they begin with the SQL hint that
      enables caching of a query or not. Storage handler cannot overrule
      the setting. It is evaluated by the core of the plugin.
     </p>
    </dd>

   
   
    <dt id="ini.mysqlnd-qc.cache-no-table">
     <em><code class="parameter">mysqlnd_qc.cache_no_table</code></em>
     <span class="type"><a href="language.types.integer.html" class="type integer">integer</a></span>
    </dt>

    <dd>

     <p class="para">
      Whether to cache queries with no table name in any of columns meta data
      of their result set, for example,
      <em>SELECT SLEEP(1)</em>, <em>SELECT NOW()</em>,
      <em>SELECT SUBSTRING()</em>.
     </p>
    </dd>

   
   
    <dt id="ini.mysqlnd-qc.use-request-time">
     <em><code class="parameter">mysqlnd_qc.use_request_time</code></em>
     <span class="type"><a href="language.types.integer.html" class="type integer">integer</a></span>
    </dt>

    <dd>

     <p class="para">
      Use PHP global request time to avoid
      <em>gettimeofday()</em> system calls?
      If using
      <em>
       <a href="ref.apc.html" class="link">APC</a>
      </em> storage handler
      it should be set to the value of
      <em>
       <a href="apc.configuration.html" class="link">apc.use_request_time</a>
      </em>, if not
      warnings will be generated.
     </p>
    </dd>

   
   
    <dt id="ini.mysqlnd-qc.time-statistics">
     <em><code class="parameter">mysqlnd_qc.time_statistics</code></em>
     <span class="type"><a href="language.types.integer.html" class="type integer">integer</a></span>
    </dt>

    <dd>

     <p class="para">
      Collect run time and store time statistics using
      <em>gettimeofday()</em> system call? Data will be
      collected only if you also set
      <em>mysqlnd_qc.collect_statistics = 1</em>,
     </p>
    </dd>

   
   
    <dt id="ini.mysqlnd-qc.collect-statistics">
     <em><code class="parameter">mysqlnd_qc.collect_statistics</code></em>
     <span class="type"><a href="language.types.integer.html" class="type integer">integer</a></span>
    </dt>

    <dd>

     <p class="para">
      Collect statistics for
      <span class="function"><a href="function.mysqlnd-qc-get-core-stats.html" class="function">mysqlnd_qc_get_core_stats()</a></span>?
      Does not influence storage handler statistics! Handler statistics
      can be an integral part of the handler internal storage format.
      Therefore, collection of some handler statistics cannot be disabled.
     </p>
    </dd>

   
   
    <dt id="ini.mysqlnd-qc.collect-statistics-log-file">
     <em><code class="parameter">mysqlnd_qc.collect_statistics-log-file</code></em>
     <span class="type"><a href="language.types.integer.html" class="type integer">integer</a></span>
    </dt>

    <dd>

     <p class="para">
      If <em>mysqlnd_qc.collect_statistics</em> and
      <em>mysqlnd_qc.collect_statistics_log_file</em>
      are set, the plugin will dump statistics into the specified
      log file at every 10th web request during PHP request shutdown.
      The log file needs to be writable by the web server user.
     </p>
     <p class="para">
      Since 1.1.0.
     </p>
    </dd>

   
   
    <dt id="ini.mysqlnd-qc.collect-query-trace">
     <em><code class="parameter">mysqlnd_qc.collect_query_trace</code></em>
     <span class="type"><a href="language.types.integer.html" class="type integer">integer</a></span>
    </dt>

    <dd>

     <p class="para">
      Collect query back traces?
     </p>
    </dd>

   
   
    <dt id="ini.mysqlnd-qc.query-trace-bt-depth">
     <em><code class="parameter">mysqlnd_qc.query_trace_bt_depth</code></em>
     <span class="type"><a href="language.types.integer.html" class="type integer">integer</a></span>
    </dt>

    <dd>

     <p class="para">
      Maximum depth/level of a query code backtrace.
     </p>
    </dd>

   
   
    <dt id="ini.mysqlnd-qc.ignore-sql-comments">
     <em><code class="parameter">mysqlnd_qc.ignore_sql_comments</code></em>
     <span class="type"><a href="language.types.integer.html" class="type integer">integer</a></span>
    </dt>

    <dd>

     <p class="para">
      Whether to remove SQL comments from a query string before
      hashing it to generate a cache key. Disable if you do not want
      two statemts such as <em>SELECT /*my_source_ip=123*/ id FROM test</em>
      and <em>SELECT /*my_source_ip=456*/ id FROM test</em> to refer
      to the same cache entry.
     </p>
     <p class="para">
      Since 1.1.0.
     </p>
    </dd>

   
   
    <dt id="ini.mysqlnd-qc.slam-defense">
     <em><code class="parameter">mysqlnd_qc.slam_defense</code></em>
     <span class="type"><a href="language.types.integer.html" class="type integer">integer</a></span>
    </dt>

    <dd>

     <p class="para">
      Activates handler based slam defense (cache stampeding protection) if available.
      Supported by
      <em>Default</em> and
      <em>
       <a href="ref.apc.html" class="link">APC</a>
      </em> storage handler
     </p>
    </dd>

   
   
    <dt id="ini.mysqlnd-qc.slam-defense-ttl">
     <em><code class="parameter">mysqlnd_qc.slam_defense_ttl</code></em>
     <span class="type"><a href="language.types.integer.html" class="type integer">integer</a></span>
    </dt>

    <dd>

     <p class="para">
      <em>TTL</em> for stale cache entries which are
      served while another client updates the entries. Supported by
      <em>
       <a href="ref.apc.html" class="link">APC</a>
      </em>
      storage handler.
     </p>
    </dd>

   
   
    <dt id="ini.mysqlnd-qc.collect-normalized-query-trace">
     <em><code class="parameter">mysqlnd_qc.collect_normalized_query_trace</code></em>
     <span class="type"><a href="language.types.integer.html" class="type integer">integer</a></span>
    </dt>

    <dd>

     <p class="para">
      Collect aggregated normalized query traces? The setting
      has no effect by default. You compile the extension
      using the define
      <em>NORM_QUERY_TRACE_LOG</em> to make use of the setting.
     </p>
    </dd>

   
   
    <dt id="ini.mysqlnd-qc.std-data-copy">
     <em><code class="parameter">mysqlnd_qc.std_data_copy</code></em>
     <span class="type"><a href="language.types.integer.html" class="type integer">integer</a></span>
    </dt>

    <dd>

     <p class="para">
      Default storage handler: copy cached wire data?
      EXPERIMENTAL – use default setting!
     </p>
    </dd>

   
   
    <dt id="ini.mysqlnd-qc.apc-prefix">
     <em><code class="parameter">mysqlnd_qc.apc_prefix</code></em>
     <span class="type"><a href="language.types.string.html" class="type string">string</a></span>
    </dt>

    <dd>

     <p class="para">
      The
      <em>
       <a href="ref.apc.html" class="link">APC</a>
      </em> storage handler stores data in the
      <em>APC</em> user cache. The setting sets a prefix to be
      used for cache entries.
     </p>
    </dd>

   
   
    <dt id="ini.mysqlnd-qc.memc-server">
     <em><code class="parameter">mysqlnd_qc.memc_server</code></em>
     <span class="type"><a href="language.types.string.html" class="type string">string</a></span>
    </dt>

    <dd>

     <p class="para">
      <em>MEMCACHE</em> storage handler: memcache server host.
     </p>
    </dd>

   
   
    <dt id="ini.mysqlnd-qc.memc-port">
     <em><code class="parameter">mysqlnd_qc.memc_port</code></em>
     <span class="type"><a href="language.types.integer.html" class="type integer">integer</a></span>
    </dt>

    <dd>

     <p class="para">
      <em>MEMCACHE</em> storage handler: memcached server port.
     </p>
    </dd>

   
   
    <dt id="ini.mysqlnd-qc.sqlite-data-file">
     <em><code class="parameter">mysqlnd_qc.sqlite_data_file</code></em>
     <span class="type"><a href="language.types.string.html" class="type string">string</a></span>
    </dt>

    <dd>

     <p class="para">
      <em>sqlite</em> storage handler: data file. Any setting
      but <em>:memory:</em> may be of little practical value.
     </p>
    </dd>

   

  </dl>

 </p>
</div><hr /><div class="manualnavbar" style="text-align: center;">
 <div class="prev" style="text-align: left; float: left;"><a href="mysqlnd-qc.installation.html">安装</a></div>
 <div class="next" style="text-align: right; float: right;"><a href="mysqlnd-qc.constants.html">预定义常量</a></div>
 <div class="up"><a href="mysqlnd-qc.setup.html">安装／配置</a></div>
 <div class="home"><a href="index.html">PHP Manual</a></div>
</div></body></html>
